package chapter4.No4_1_使用reentrantLock类.demo1;

/**
 * *：
 *   ReentrantLock的使用
 *   x.lock(); 获取锁
 *   x.unlock(); 释放锁
 * @author liujian
 * @version 2016/11/21 0021
 */
public class Main {
    public static void main(String[] args) {
        ServiceClass sc = new ServiceClass();
        MyThread a = new MyThread(sc);
        a.setName("a");
        MyThread b = new MyThread(sc);
        b.setName("b");
        MyThread c = new MyThread(sc);
        c.setName("c");
        MyThread d = new MyThread(sc);
        d.setName("d");

        a.start();
        b.start();
        c.start();
        d.start();
    }
}
